package numbers;

import java.util.ArrayList;

/**
 *获取素数的个数
 */
public class Demo1 {
    public static void main(String[] args) {
        int count=0;
        ArrayList<Integer> ints = new ArrayList();
        for (int i = 101; i <=200; i++) {
            int a=0;
            for (int j = 2; j <i ; j++) {
                if (i%j==0){
                    //只要有一个能整除a就不是0
                    a++;
                }
            }
            if (a==0){
                count++;
                ints.add(i);
            }
        }
        System.out.println("素数个数:"+count);
        for (Integer anInt : ints) {
            System.out.print(anInt+" ");
        }
    }
}
